QT += core widgets xml sql network

DEFINES += BUILD_COMMON_LIB_STATIC BUILD_GATE_STATIC BUILD_CLIENT_STATIC BUILD_CLIENT_SOCKET_STATIC BUILD_CSPROTO_STATIC BUILD_SERVER_STATIC BUILD_SERVER_SOCKET_STATIC

CONFIG += c++11

include(../pub_common.pri)

# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

SOURCES += \
    gn_viewer/sysfilepathsmodel.cpp \
    client.cpp \
    gn_viewer/sysfilepathsview.cpp \
    gn_viewer/sysgnmainwindow.cpp \
    logindialog.cpp \
    mainwindow.cpp \
    syslogin.cpp \
    syspushfilefilter.cpp

HEADERS += \
    gn_viewer/sysfilepathsmodel.h \
    client_global.h \
    client.h \
    gn_viewer/sysfilepathsview.h \
    gn_viewer/sysgnmainwindow.h \
    logindialog.h \
    mainwindow.h \
    syslogin.h \
    syspushfilefilter.h

INCLUDEPATH += $$PWD/../lib/libuv_qmake \
    $$PWD/../lib/libuv/include \
    $$PWD/../lib/libuv/src/win \
    $$PWD/../client-socket \
    $$PWD/../csproto-lib \
    $$PWD/../lib \
    $$PWD/../server-socket \
    $$PWD/../server \
    $$PWD/../gate \
    $$PWD/../framework \
    $$PWD/../lib/log4cplus/include \
    $$PWD/../common_lib

TRANSLATIONS+=../config/cns_zh_CN.ts

OTHER_FILES += \
    ../cns/client/client.xml

QMAKE_POST_LINK += $$MY_COPY($$PWD/../sql/*, $$OUT_PWD/sql/)
QMAKE_POST_LINK += $$MY_COPY($$PWD/../config/cns_zh_CN.qm, $$OUT_PWD/config/)
QMAKE_POST_LINK += $$MY_COPY($$PWD/../qhttpserver/config/*.json, $$OUT_PWD/config/)
QMAKE_POST_LINK += $$MY_COPY_DIR($$PWD/../cns/*, $$OUT_PWD/cns/)
QMAKE_POST_LINK += $$MY_COPY_DIR($$PWD/../qhttpserver/www/*, $$OUT_PWD/www/)

# Default rules for deployment.
#unix {
#    target.path = /usr/lib
#}
#!isEmpty(target.path): INSTALLS += target

CONFIG(debug, debug|release) {
    message('Compiling in DEBUG mode')
    BUILDTYPE = Debug
} else {
    message('Compiling in RELEASE mode')
    BUILDTYPE = Release
}

win32 {
LIBS += \
  WS2_32.Lib \
  Psapi.Lib \
  AdvAPI32.Lib \
  User32.Lib \
  iphlpapi.lib \
  userenv.lib
}
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../csproto-lib/release/ -lcsproto-lib
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../csproto-lib/debug/ -lcsproto-lib
else:unix: LIBS += -L$$OUT_PWD/../csproto-lib/ -lcsproto-lib

win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../client-socket/release/ -lclient-socket
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../client-socket/debug/ -lclient-socket
else:unix: LIBS += -L$$OUT_PWD/../client-socket/ -lclient-socket

win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../server/release/ -lserver_lib
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../server/debug/ -lserver_lib
else:unix: LIBS += -L$$OUT_PWD/../server/ -lserver_lib

win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../gate/release/ -lgate_lib
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../gate/debug/ -lgate_lib
else:unix: LIBS += -L$$OUT_PWD/../gate/ -lgate_lib

win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../common_lib/release/ -lcommon_lib
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../common_lib/debug/ -lcommon_lib
else:unix: LIBS += -L$$OUT_PWD/../common_lib/ -lcommon_lib

win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../qhttpserver/release/ -lqttpserver
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../qhttpserver/debug/ -lqttpserver
else:unix: LIBS += -L$$OUT_PWD/../qhttpserver/ -lqttpserver

win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../lib/log4cplus_qmake/release/ -llog4cplus
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../lib/log4cplus_qmake/debug/ -llog4cplus
else:unix: LIBS += -L$$OUT_PWD/../lib/log4cplus_qmake/ -llog4cplus

win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../lib/protobuf_qmake/release/ -lprotobuf
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../lib/protobuf_qmake/debug/ -lprotobuf
else:unix: LIBS += -L$$OUT_PWD/../lib/protobuf_qmake/ -lprotobuf

win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../lib/libuv_qmake/release/ -luv
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../lib/libuv_qmake/debug/ -luv
else:unix: LIBS += -L$$OUT_PWD/../lib/libuv_qmake/ -luv

win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../lib/http/release/ -lnode_native
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../lib/http/debug/ -lnode_native
else:unix: LIBS += -L$$OUT_PWD/../lib/http/ -lnode_native

win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../lib/llhttp_qmake/release/ -lllhttp
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../lib/llhttp_qmake/debug/ -lllhttp
else:unix: LIBS += -L$$OUT_PWD/../lib/llhttp_qmake/ -lllhttp

win32{
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../lib/breakpad/common/release/ -lcommon
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../lib/breakpad/common/debug/ -lcommon
else:unix: LIBS += -L$$OUT_PWD/../lib/breakpad/common/ -lcommon

win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../lib/breakpad/client/windows/handler/release/ -lexception_handler
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../lib/breakpad/client/windows/handler/debug/ -lexception_handler
else:unix: LIBS += -L$$OUT_PWD/../lib/client/windows/handler/ -lexception_handler

win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../lib/breakpad/client/windows/crash_generation/release/ -lcrash_generation_client
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../lib/breakpad/client/windows/crash_generation/debug/ -lcrash_generation_client
else:unix: LIBS += -L$$OUT_PWD/../lib/client/windows/crash_generation/ -lcrash_generation_client
} else:unix{
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../lib/breakpad/release/ -lbreakpad
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../lib/breakpad/debug/ -lbreakpad
else:unix: LIBS += -L$$OUT_PWD/../lib/breakpad/ -lbreakpad
}

win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../server-socket/release/ -lserver-socket
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../server-socket/debug/ -lserver-socket
else:unix: LIBS += -L$$OUT_PWD/../server-socket/ -lserver-socket

win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../framework/release/ -lframework
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../framework/debug/ -lframework
else:unix: LIBS += -L$$OUT_PWD/../framework/ -lframework

win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../server-socket/release/server-socket.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../server-socket/debug/server-socket.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../server-socket/release/server-socket.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../server-socket/debug/server-socket.lib
else:unix: PRE_TARGETDEPS += $$OUT_PWD/../server-socket/libserver-socket.a

win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../client-socket/release/client-socket.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../client-socket/debug/client-socket.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../client-socket/release/client-socket.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../client-socket/debug/client-socket.lib
else:unix: PRE_TARGETDEPS += $$OUT_PWD/../client-socket/libclient-socket.a

win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../csproto-lib/release/csproto-lib.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../csproto-lib/debug/csproto-lib.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../csproto-lib/release/csproto-lib.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../csproto-lib/debug/csproto-lib.lib
else:unix: PRE_TARGETDEPS += $$OUT_PWD/../csproto-lib/libcsproto-lib.a

win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../server/release/server_lib.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../server/debug/server_lib.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../server/release/server_lib.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../server/debug/server_lib.lib
else:unix: PRE_TARGETDEPS += $$OUT_PWD/../server/libserver_lib.a

win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../gate/release/gate_lib.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../gate/debug/gate_lib.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../gate/release/gate_lib.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../gate/debug/gate_lib.lib
else:unix: PRE_TARGETDEPS += $$OUT_PWD/../gate/libgate_lib.a

win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../common_lib/release/common_lib.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../common_lib/debug/common_lib.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../common_lib/release/common_lib.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../common_lib/debug/common_lib.lib
else:unix: PRE_TARGETDEPS += $$OUT_PWD/../common_lib/libcommon_lib.a

win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../framework/release/framework.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../framework/debug/framework.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../framework/release/framework.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../framework/debug/framework.lib
else:unix: PRE_TARGETDEPS += $$OUT_PWD/../framework/libframework.a

FORMS += \
    logindialog.ui \
    mainwindow.ui

RESOURCES += \
    qss.qrc
